package com.lk.sys.common.web;

import com.lk.sys.common.vo.JsonResult;
import org.springframework.web.bind.annotation.ControllerAdvice;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseBody;
/**
 * 全局异常处理类
 * @author Lukang
 * @date 2021/10/26 下午9:39
 * @param
 * @return null
 */
@ControllerAdvice
public class GlobalHandlerException {

    @ExceptionHandler(RuntimeException.class)
    @ResponseBody
    public JsonResult doHandlerRuntimeException(RuntimeException e) {
        e.printStackTrace();
        return new JsonResult(e);
    }
}
